package src.lab02.test11;

/**
 * Created by 林云志 on 2017/11/16.
 */
public class Square extends Rectangle implements Printx {
    Square(int length, int width) {
        super(length, width);
    }



    public double diagonal(){
        double diagonal = length * Math.sqrt(2);
        return diagonal;
    }

    @Override
    public void printMyWay() {
        System.out.println("正方形边长为："+length+"  面积为："+area(5,5)+"  周长为:"+primeter(5,5)+"  对角线长："+diagonal());

    }
}
